amlogic: Move efuse code to common directory
authorCarlo Caione <[email protected]>
Sat, 24 Aug 2019 16:43:33 +0000 (17:43 +0100)
committerCarlo Caione <[email protected]>
Thu, 5 Sep 2019 09:39:30 +0000 (10:39 +0100)
The efuse code is the same between GXL and GXBB. Move the code to common
directory.

Signed-off-by: Carlo Caione <[email protected]>
Change-Id: Ie37f21d1907a36292724f1fb645a78041fe4a6b3

plat/amlogic/common/aml_efuse.c [new file with mode: 0644]
plat/amlogic/gxbb/gxbb_efuse.c [deleted file]
plat/amlogic/gxbb/platform.mk
plat/amlogic/gxl/gxl_efuse.c [deleted file]
plat/amlogic/gxl/platform.mk

diff --git a/plat/amlogic/common/aml_efuse.c b/plat/amlogic/common/aml_efuse.c
new file mode 100644 (file)
index 0000000..4124802
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdint.h>
+
+#include "aml_private.h"
+
+#define EFUSE_BASE     0x140
+#define EFUSE_SIZE     0xC0
+
+uint64_t gxbb_efuse_read(void *dst, uint32_t offset, uint32_t size)
+{
+       if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE)
+               return 0;
+
+       return scpi_efuse_read(dst, offset + EFUSE_BASE, size);
+}
+
+uint64_t gxbb_efuse_user_max(void)
+{
+       return EFUSE_SIZE;
+}
diff --git a/plat/amlogic/gxbb/gxbb_efuse.c b/plat/amlogic/gxbb/gxbb_efuse.c
deleted file mode 100644 (file)
index 4124802..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <stdint.h>
-
-#include "aml_private.h"
-
-#define EFUSE_BASE     0x140
-#define EFUSE_SIZE     0xC0
-
-uint64_t gxbb_efuse_read(void *dst, uint32_t offset, uint32_t size)
-{
-       if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE)
-               return 0;
-
-       return scpi_efuse_read(dst, offset + EFUSE_BASE, size);
-}
-
-uint64_t gxbb_efuse_user_max(void)
-{
-       return EFUSE_SIZE;
-}
index 2430f234046a37bcc1f72bd431c25067bfb79272..d2d337cafbaafe795b9cce3a1a765a9e509f6d5e 100644 (file)
@@ -28,7 +28,7 @@ BL31_SOURCES          +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
                                ${AML_PLAT_COMMON}/aarch64/aml_helpers.S        \
                                ${AML_PLAT_SOC}/gxbb_bl31_setup.c       \
-                               ${AML_PLAT_SOC}/gxbb_efuse.c            \
+                               ${AML_PLAT_COMMON}/aml_efuse.c          \
                                ${AML_PLAT_SOC}/gxbb_mhu.c              \
                                ${AML_PLAT_SOC}/gxbb_pm.c               \
                                ${AML_PLAT_COMMON}/aml_scpi.c           \
diff --git a/plat/amlogic/gxl/gxl_efuse.c b/plat/amlogic/gxl/gxl_efuse.c
deleted file mode 100644 (file)
index 4124802..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <stdint.h>
-
-#include "aml_private.h"
-
-#define EFUSE_BASE     0x140
-#define EFUSE_SIZE     0xC0
-
-uint64_t gxbb_efuse_read(void *dst, uint32_t offset, uint32_t size)
-{
-       if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE)
-               return 0;
-
-       return scpi_efuse_read(dst, offset + EFUSE_BASE, size);
-}
-
-uint64_t gxbb_efuse_user_max(void)
-{
-       return EFUSE_SIZE;
-}
index f2394829a4b40a2185985e090ebfb816c54c8b00..5c8206cf143626b4f0e71194ae1f9f5fbddee66c 100644 (file)
@@ -31,7 +31,7 @@ BL31_SOURCES          +=      lib/cpus/aarch64/cortex_a53.S           \
                                plat/common/plat_psci_common.c          \
                                ${AML_PLAT_COMMON}/aarch64/aml_helpers.S        \
                                ${AML_PLAT_SOC}/gxl_bl31_setup.c        \
-                               ${AML_PLAT_SOC}/gxl_efuse.c             \
+                               ${AML_PLAT_COMMON}/aml_efuse.c          \
                                ${AML_PLAT_SOC}/gxl_mhu.c               \
                                ${AML_PLAT_SOC}/gxl_pm.c                \
                                ${AML_PLAT_COMMON}/aml_scpi.c           \